<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>

	<script>

		var foo = function(x) {
			x++;
			return function(y) {
				return x * y;
			};
		};

		var x = foo(5)(10);

		console.log(x);
		
	</script>
</body>
</html>